{% extends 'core/base.html' %}
{% load staticfiles %}
{% block title %}Subscriptions | {{ block.super }}{% endblock %}

{% block extra-js %}
        <script src="{% static 'accounts/js/profile.js' %}"></script>
{% endblock %}

{% block content %}

{% include 'accounts/profile-navbar.html' with active_element='subscriptions' %}
{% if package %}
<h3>Modify keywords for subscription to {{ package }} ({{ email }})</h3>
{% else %}
<h3>Modify default keywords for {{ email }}</h3>
{% endif %}
        <form id="choose-keywords-form" action="{% url 'dtracker-accounts-profile-keywords' %}" method="POST">{% csrf_token %}
            {% for name, value in post.items %}
            <input type="hidden" name="{{ name }}" value="{{ value }}">
            {% endfor %}
            <input type="hidden" name="next" value="{% url 'dtracker-accounts-subscriptions' %}">
                <div id="choose-keywords-list">
                    <dl class="dl-horizontal">
                    {% for keyword in keywords %}
                      <dt class="col-sm-3">
                        <input id="{{ keyword }}" class="keyword-choice" type="checkbox" {% if keyword in user_keywords %}checked{% endif %} name="email" value="{{ keyword }}">
                        <label for="{{ keyword }}">{{ keyword }}</label>
                      </dt>
                      <dd class="col-sm-9">{{ keyword.description }}</dd>
                    {% endfor %}
                    </dl>
                </div>
                <button class="btn btn-default">Change keywords</button>
        </form>
{% endblock %}
